@extends('admin.app')

@section('content')
    <link rel="stylesheet" href="{{assethelp('/css/admin/attendance-manage.css?v='.time())}}">
    <link rel="stylesheet" href="/css/icon/iconfont-0130.css">
    <div class="mian-container">
        <div class="attendance-manage">
         {{--   <div class="weui-cells">
                <a class="weui-cell weui-cell_access" href="javascript:;">
                    <div class="weui-cell__bd">
                        <p>考勤：</p>
                    </div>
                    <div class="weui-cell__ft">
                    </div>
                </a>
            </div>--}}
            <div class="center-list">
                @foreach($tongxunlu as $t)
                <div class="section-list">
                    <h3 class="h3-title">
                        @if($t['group_name'] != '我的同事')
                            <img class="con-img" src="{{asset('/img/list-user1.png')}}">
                        @endif{{$t['group_name']}}
                    </h3>

                    <span class="num-span"></span>
                    <ul>
                        @foreach($t['member'] as $m)
                            <li>
                                <a href="attendance/{{$m['id']}}" style="display: inline-block;height: 100%;width: 100%;">
                                <img class="sec-img" src="{{userlogo($m['id'])}}">
                                <span class="sec-name">{{$m['qw_name']}}</span>
                                @foreach($m['role'] as $mr)
                                    <span class="circle-span @if($mr==9) span-total @elseif($mr==10) span-exam @elseif($mr==11) span-score @elseif($mr==12) span-reward @endif">{{$roleArray[$mr]}}</span>
                                @endforeach
                                    @if($m['is_sales'] == 1)
                                        <span class="circle-span span-sell">销</span>
                                    @endif
                                </a>
                            </li>
                        @endforeach
                    </ul>
                    @if(isset($t['child']))
                        @foreach($t['child'] as $c)
                            <div class="second-list">
                                <h3 class="h3-title"><img class="con-img" src="{{asset('/img/list-user1.png')}}">{{$c['group_name']}}</h3>
                                <span class="num-span"></span>
                                <ul>
                                    @foreach($c['member'] as $cm)
                                        <li>
                                            <a href="attendance/{{$cm['id']}}" style="display: inline-block;height: 100%;width: 100%;">
                                            <img class="sec-img" src="{{userlogo($cm['id'])}}">
                                            <span class="sec-name">{{$cm['qw_name']}}</span>
                                            @if($cm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                            @foreach($cm['role'] as $cmr)
                                                <span class="circle-span @if($cmr==9) span-total @elseif($cmr==10) span-exam @elseif($cmr==11) span-score @elseif($cmr==12) span-reward @endif">{{$roleArray[$cmr]}}</span>
                                            @endforeach
                                                @if($cm['is_sales'] == 1)
                                                    <span class="circle-span span-sell">销</span>
                                                @endif
                                            </a>
                                        </li>
                                    @endforeach
                                </ul>
                                @foreach($c['child'] as $cc)
                                    <div class="third-list">
                                        <h3 class="h3-title"><img class="con-img" src="{{asset('/img/list-user1.png')}}">{{$cc['group_name']}}</h3>
                                        <span class="num-span"></span>
                                        <ul>
                                            @foreach($cc['member'] as $ccm)
                                                <li>
                                                    <a href="attendance/{{$ccm['id']}}" style="display: inline-block;height: 100%;width: 100%;">
                                                    <img class="sec-img" src="{{userlogo($ccm['id'])}}">
                                                    <span class="sec-name">{{$ccm['qw_name']}}</span>
                                                    @if($ccm['is_leader'] == 1)<i class="icon iconfont icon-qizi"></i>@endif
                                                    @foreach($ccm['role'] as $ccmr)
                                                        <span class="circle-span @if($ccmr==9) span-total @elseif($ccmr==10) span-exam @elseif($ccmr==11) span-score @elseif($ccmr==12) span-reward @endif">{{$roleArray[$ccmr]}}</span>
                                                    @endforeach
                                                        @if($ccm['is_sales'] == 1)
                                                            <span class="circle-span span-sell">销</span>
                                                        @endif
                                                    </a>
                                                </li>
                                            @endforeach
                                        </ul>
                                    </div>
                                @endforeach
                            </div>
                        @endforeach
                    @endif
                </div>
                @endforeach
          
            </div>
        </div>
        <!--阴影遮罩-->
        @if($user->getRole()==9)

            @include('sysadmin.admin-caidan')
        @else
            <div class="reful-tabbar">
                <a href="{{url('/user/performance/perf')}}" class="tabbar-item">
                    <p style="line-height: 65px;" class="tabbar-label">返回个人用户界面</p>
                </a>
            </div>

        @endif
    </div>

    <script>
        $(document).ready(function () {
            $('.admin-item').click(function(){
                $('.front-show-hidden').toggle();
            });
            $('.kaohe-item').click(function(){
                $('.show-hidden').toggle();
            })
            $('.num-span').each(function(){
                $(this).text($(this).next('ul').children().length);
            });
            $('.h3-title').click(function(){
                $(this).toggleClass('ah3-title');
                $(this).siblings('ul').toggle();
            });
            $('.add-link').click(function(){
                $('.list-shadow').toggle();
                $('.hidden-add').toggle();
                $('.icon-san').toggle();
            })
        })
    </script>
@endsection